package com.lucy.starter.exception;

import com.lucy.starter.constant.HttpStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.concurrent.CompletionException;

@EqualsAndHashCode(callSuper = true)
@Data
public class AsyncBusinessException extends CompletionException {
    Integer code;

    public AsyncBusinessException(){}
    public AsyncBusinessException(String message){
        super(message);
    }
    public AsyncBusinessException(String message, Throwable cause){
        super(message, cause);
    }
    public AsyncBusinessException(Throwable cause){
        super(cause);
    }
    public AsyncBusinessException(HttpStatus status){
        super(status.getReasonPhrase());
        this.code = status.value();
    }
    public AsyncBusinessException(HttpStatus status, String msg){
        super(msg);
        this.code = status.value();
    }
    public AsyncBusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super();
    }
}
